package com.ys.sb.hessian.config;

import com.ys.sb.hessian.service.HelloService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.caucho.HessianProxyFactoryBean;

@Configuration
public class HessianConfig {


    /**
     * 外部依赖服务
     *
     * @return
     */
    @Bean(name = "helloService")
    public HessianProxyFactoryBean getHelloService() {
        HessianProxyFactoryBean proxy = new HessianProxyFactoryBean();
        proxy.setServiceUrl("http://localhost:8083/helloService.service");
        proxy.setServiceInterface(HelloService.class);
        return proxy;
    }


}
